const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
    transpileDependencies: ['uview-ui'],
    devServer: {
        open: true,
        port: 8070, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    },
    configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	}
}